import 'package:flutter/material.dart';

class AqAvatar extends StatelessWidget {
  final double radius;
  final String? imageUrl;
  final VoidCallback? onTap;
  static const _defaultColor = Color.fromRGBO(217, 217, 217, 1);

  const AqAvatar({
    super.key,
    required this.radius,
    this.imageUrl,
    this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        decoration: BoxDecoration(
          shape: BoxShape.circle,
          border: Border.all(
            color: Colors.white,
            width: 4.0,
          ),
        ),
        child: CircleAvatar(
          radius: radius,
          backgroundColor: _defaultColor,
          backgroundImage: imageUrl != null
              ? NetworkImage(imageUrl!)
              : null,
        ),
      ),
    );
  }
}
